package com.wfm.lifecycle;

import com.wfm.ch1.di.UseFunctionService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration //1
@ComponentScan("com.wfm.lifecycle") //2
public class Main {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(Main.class); //1

        LifeCycleTest lifeCycleTest = context.getBean("lifeCycleTest", LifeCycleTest.class);

        context.close();
    }
}